<?php
$this->breadcrumbs=array(
	'Site News Categories'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'Create News Category', 'url'=>array('create')),
	array('label'=>'Manage News Category', 'url'=>array('list')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('site-news-category-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<div class="flat_area grid_16">
    <h2>Manage News Category</h2>
</div>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'site-news-category-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
            array(
            'name' => 'news_category_title',
            'value' => '$data->news_category_title',
            ),
            array(
            'name' => 'news_category_is_active',
            'type' => 'image',
            'value' => '($data->news_category_is_active == 1 ? Yii::app()->params[\'backendUrl\'] . "/images/yii/stat-unblock.png" : Yii::app()->params[\'backendUrl\'] . "/images/yii/stat-block.png")',
            'filter' => CHtml::activeDropDownList($model, 'news_category_is_active', array('' => '', '1' => 'Active', '0' => 'InActive')),
            'htmlOptions' => array('style' => 'text-align:center;'),
            ),
            array(
            'header' => 'Action',
            'class' => 'CButtonColumn',
            ),
	
    ),
    
    'selectableRows' => 2,
    'selectionChanged' => 'userClicks',
    'pager' => array(
        'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-pager.css',
        'header' => '',
        'firstPageLabel' => 'First',
        'prevPageLabel' => 'Previous',
        'nextPageLabel' => 'Next',
        'lastPageLabel' => 'Last',
    ),
    'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-gridview.css',
    'loadingCssClass' => '',
)); ?>

<script>
    var id = 0;
    function userClicks(target_id) {
        id = $.fn.yiiGridView.getSelection(target_id);
    }
</script>